﻿<?php
error_reporting(0);
define('IN_QY',true);
session_start();
require("include/common.inc.php");
define('SCRIPT','ad_list');

?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>闲置交易</title>
        <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
        <meta content="yes" name="apple-mobile-web-app-capable"/>
        <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
        <meta content="telephone=no" name="format-detection"/>
        <link href="/ui/xianzhi/css/style.css" rel="stylesheet" type="text/css"/>
        <script type="text/javascript" src="/ui/xianzhi/js/jquery.min.js"></script>
        <script type="text/javascript" src="/ui/xianzhi/js/slider.js"></script>
		<script src="dropload.min.js"></script>
		<script type="text/javascript" src="/ui/layer/mobile/layer.js"></script> 
		<style type="text/css">
			.aui-shop-list-selected .aui-shop-list-item {
   
    height: 230px;
}
.aui-shop-list-item-hd img {
    width: 100%;
    height: 135px;
    display: block;
    border: none;
}
p.aui-special-text {

    height: 15px;
}
.aui-shop-list-selected .aui-shop-list-item {
    height: 260px;
}
		</style>
    </head>
    <body>
        <section class="aui-flexView">
            <header class="aui-navBar aui-navBar-fixed">
                <a href="javascript:history.back(-1);" class="aui-navBar-item">
                    <i class="icon icon-return"></i>
                </a>
                <div class="aui-center">
                    <span class="aui-center-title">闲置交易</span>
                </div>
				<!--------------------
                <a href="javascript:;" class="aui-navBar-item">
                    <i class="icon icon-share"></i>
                    <i class="icon icon-more"></i>
                </a>
				---------------------->
            </header>
            <section class="aui-scrollView">
                <div onclick="location='mysearch.php'" class="aui-search-box">
                    <div class="aui-search-bg">
                        <i class="icon icon-search"></i>
                        <input type="text" placeholder="搜索">
                    </div>
                </div>
                <div class="aui-m-slider">
                    <div class="m-slider" data-ydui-slider>
                        <div class="slider-wrapper">
                            <div class="slider-item">
                                <a href="javascript:;">
                                    <img src="/ui/image/闲置首页轮播.jpg">
                                </a>
                            </div>

                        </div>
                        <div class="slider-pagination"></div>
                    </div>
                </div>
                <div class="aui-palace clearfix" style="padding: 2px 0;">
                    <a href="xianzhilist.php?y=147" class="aui-palace-grid">
                        <div class="aui-palace-grid-icon">
                            <img src="/ui/xianzhi/images/婴幼服饰.png" alt="">
                        </div>
                        <div class="aui-palace-grid-text">
                            <h2>婴幼服饰</h2>
                        </div>
                    </a>
                    <a href="xianzhilist.php?y=147" class="aui-palace-grid">
                        <div class="aui-palace-grid-icon">
                            <img src="/ui/xianzhi/images/尿裤湿巾.png" alt="">
                        </div>
                        <div class="aui-palace-grid-text">
                            <h2>尿裤湿巾</h2>
                        </div>
                    </a>
                    <a href="xianzhilist.php?y=147" class="aui-palace-grid">
                        <div class="aui-palace-grid-icon">
                            <img src="/ui/xianzhi/images/童床推车.png" alt="">
                        </div>
                        <div class="aui-palace-grid-text">
                            <h2>童床推车</h2>
                        </div>
                    </a>
                    <a href="xianzhilist.php?y=147" class="aui-palace-grid">
                        <div class="aui-palace-grid-icon">
                            <img src="/ui/xianzhi/images/安全座椅.png" alt="">
                        </div>
                        <div class="aui-palace-grid-text">
                            <h2>安全座椅</h2>
                        </div>
                    </a>
                    <a href="xianzhilist.php?y=147" class="aui-palace-grid">
                        <div class="aui-palace-grid-icon">
                            <img src="/ui/xianzhi/images/玩具书籍.png" alt="">
                        </div>
                        <div class="aui-palace-grid-text">
                            <h2>玩具书籍</h2>
                        </div>
                    </a>
                    <a href="xianzhilist.php?y=147" class="aui-palace-grid">
                        <div class="aui-palace-grid-icon">
                            <img src="/ui/xianzhi/images/孕妈必备.png" alt="">
                        </div>
                        <div class="aui-palace-grid-text">
                            <h2>孕妈必备</h2>
                        </div>
                    </a>
                    <a href="xianzhilist.php?y=147" class="aui-palace-grid">
                        <div class="aui-palace-grid-icon">
                            <img src="/ui/xianzhi/images/喂养组合.png" alt="">
                        </div>
                        <div class="aui-palace-grid-text">
                            <h2>喂养组合</h2>
                        </div>
                    </a>
                    <a href="xianzhilist.php?y=147" class="aui-palace-grid">
                        <div class="aui-palace-grid-icon">
                            <img src="/ui/xianzhi/images/其他.png" alt="">
                        </div>
                        <div class="aui-palace-grid-text">
                            <h2>其他</h2>
                        </div>
                    </a>
                </div>
				
			    <nav class="aui-nav-box">
                    <div id="tui" onclick="tui()" class="aui-nav-item aui-nav-item-active">推荐</div>
                    <div  id="fuj" onclick="fuj()" class="aui-nav-item">附近</div>	
                    <div  id="news" onclick="news()" class="aui-nav-item">最新</div>					
                </nav>
  
			      <div class="content">

                    <div class="aui-shop-list aui-shop-list-selected">

                    </div>
					
					
                </div>	


            </section>

        </section>
		
			<script>
// 最新			
			      function news(){
                  var dom2 = document.getElementById('news');
                  var dom3 = document.getElementById('tui');
                  var dom4 = document.getElementById('fuj');				  
                  $(dom2).toggleClass('aui-nav-item');
                  $(dom3).removeClass('aui-nav-item-active')
                  $(dom4).removeClass('aui-nav-item-active')				  
                  $(dom2).addClass('aui-nav-item');
                  $(dom2).addClass('aui-nav-item-active');				  
					layer.open({
                    content: '最新商品加载中...'
                   ,skin: 'msg'
                   ,time: 1 //2秒后自动关闭
                    });	
					
					$(function(){
	$(".aui-shop-list").empty();	
		
    // 页数
    var page = 0;
     $('.content').dropload({
        scrollArea : window,
        loadDownFn : function(me){
            page++;
            // 拼接HTML
            var result = '';
            $.ajax({
                type: 'GET',
                url: 'xianzhiapi.php?page='+page+'&sname=2',
                dataType: 'json',
                success: function(data){
					
					if(data==0){
						me.lock();
                        // 无数据
                        me.noData();
						  me.resetload();
						$(".dropload-noData").empty();	
					    $(".dropload-load").empty();
					 // layer.open({
                    // content: 'end'
                   // ,skin: 'msg'
                   // ,time: 2 //2秒后自动关闭
                    // });	
					return false;	
					}
					
					   var arrLen = data.data.length;
			
                    if(arrLen > 0){

                        for(var i=0; i<arrLen; i++){
							
                            result += '<a href="/haigou/htspxq.php?fid='+data.data[i].id+'" class="aui-shop-list-item">'
                             +'<div class="aui-shop-list-item-hd">'
                              + ' <img src="'+data.data[i].img+'" alt="">'
                           +' </div>	'					
                           + '<div class="aui-shop-list-item-bd">'
                               + '<h3>'+data.data[i].title+'</h3>'
                               + '<p class="aui-special-text">'
                               +  '<span>'+data.data[i].enbrand+'</span>'
                               + '</p>'
                              + ' <p class="aui-special-etc">'
                                  + ' <span class="aui-special-etc-hd">￥'+data.data[i].price+'</span>'
                       +'<img src="'+data.data[i].tximg+'" alt="" style="width: 20px;margin-left: 25px;">'
				+' <span style="margin-top: 5px;position: absolute;margin-left: 10px;font-size: 8px;float: right;line-height:20px;">'+data.data[i].txname+'</span>'
                   + '</p>'
                           + '</div>'
                       +' </a>'

                        }
                    // 如果没有数据
                    }else{
   						alert('无搜索结果');  
						// 锁定
                        me.lock();
                        // 无数据
                        me.noData();
						

                    }
                        // 插入数据到页面，放到最后面
                        $('.aui-shop-list').append(result);
                        // 每次数据插入，必须重置
                        me.resetload();
							
                
                },
                error: function(xhr, type){
					 layer.open({
                    content: '网络异常，请稍等'
                   ,skin: 'msg'
                   ,time: 2 //2秒后自动关闭
                    });	
					
                    me.resetload();
                }
            });
        }
    });
	
	
	
});		
						
			  }
			  
// 热推			  
			  
			  function tui(){
                  var dom3 = document.getElementById('news');
                  var dom2 = document.getElementById('tui');
                  var dom4 = document.getElementById('fuj');				  
                  $(dom2).toggleClass('aui-nav-item');
                  $(dom3).removeClass('aui-nav-item-active')
                  $(dom4).removeClass('aui-nav-item-active')				  
                  $(dom2).addClass('aui-nav-item');
                  $(dom2).addClass('aui-nav-item-active');
				  
					layer.open({
                    content: '推荐商品加载中...'
                   ,skin: 'msg'
                   ,time: 1 
                    });	
			
	$(function(){
	$(".aui-shop-list").empty();	
		
    // 页数
    var page = 0;
     $('.content').dropload({
        scrollArea : window,
        loadDownFn : function(me){
            page++;
            // 拼接HTML
            var result = '';
            $.ajax({
                type: 'GET',
                url: 'xianzhiapi.php?page='+page+'&sname=1',
                dataType: 'json',
                success: function(data){
					
					if(data==0){
						me.lock();
                        // 无数据
                        me.noData();
						  me.resetload();
						$(".dropload-noData").empty();	
					    $(".dropload-load").empty();
					 // layer.open({
                    // content: 'end'
                   // ,skin: 'msg'
                   // ,time: 2 //2秒后自动关闭
                    // });	
					return false;	
					}
					
					   var arrLen = data.data.length;
			
                    if(arrLen > 0){

                        for(var i=0; i<arrLen; i++){
							
                            result += '<a href="/haigou/htspxq.php?fid='+data.data[i].id+'" class="aui-shop-list-item">'
                             +'<div class="aui-shop-list-item-hd">'
                              + ' <img src="'+data.data[i].img+'" alt="">'
                           +' </div>	'					
                           + '<div class="aui-shop-list-item-bd">'
                               + '<h3>'+data.data[i].title+'</h3>'
                               + '<p class="aui-special-text">'
                               +  '<span>'+data.data[i].enbrand+'</span>'
                               + '</p>'
                              + ' <p class="aui-special-etc">'
                                  + ' <span class="aui-special-etc-hd">￥'+data.data[i].price+'</span>'
                       +'<img src="'+data.data[i].tximg+'" alt="" style="width: 20px;margin-left: 25px;">'
				+' <span style="margin-top: 5px;position: absolute;margin-left: 10px;font-size: 8px;float: right;">'+data.data[i].txname+'</span>'
                   + '</p>'
                           + '</div>'
                       +' </a>'

                        }
                    // 如果没有数据
                    }else{
   						alert('无搜索结果');  
						// 锁定
                        me.lock();
                        // 无数据
                        me.noData();
						

                    }
                        // 插入数据到页面，放到最后面
                        $('.aui-shop-list').append(result);
                        // 每次数据插入，必须重置
                        me.resetload();
							
                
                },
                error: function(xhr, type){
					
					 layer.open({
                    content: '网络异常，请稍等'
                   ,skin: 'msg'
                   ,time: 2 //2秒后自动关闭
                    });	
					
                    // 即使加载出错，也得重置
                    me.resetload();
                }
            });
        }
    });
	
	
	
});	
		
		

		
			  }	

//附近
			  function fuj(){
                  var dom3 = document.getElementById('news');
                  var dom2 = document.getElementById('tui');
                  var dom4 = document.getElementById('fuj');				  

                  $(dom3).removeClass('aui-nav-item-active')
                  $(dom2).removeClass('aui-nav-item-active')				  
                  $(dom4).addClass('aui-nav-item');
                  $(dom4).addClass('aui-nav-item-active');
				  
					layer.open({
                    content: '推荐商品加载中...'
                   ,skin: 'msg'
                   ,time: 1 
                    });	
			
	$(function(){
	$(".aui-shop-list").empty();	
		
    // 页数
    var page = 0;
     $('.content').dropload({
        scrollArea : window,
        loadDownFn : function(me){
            page++;
            // 拼接HTML
            var result = '';
            $.ajax({
                type: 'GET',
                url: 'xianzhiapi.php?page='+page+'&sname=1',
                dataType: 'json',
                success: function(data){
					
					if(data==0){
						me.lock();
                        // 无数据
                        me.noData();
						  me.resetload();
						$(".dropload-noData").empty();	
					    $(".dropload-load").empty();
					 // layer.open({
                    // content: 'end'
                   // ,skin: 'msg'
                   // ,time: 2 //2秒后自动关闭
                    // });	
					return false;	
					}
					
					   var arrLen = data.data.length;
			
                    if(arrLen > 0){

                        for(var i=0; i<arrLen; i++){
							
                            result += '<a href="/haigou/htspxq.php?fid='+data.data[i].id+'" class="aui-shop-list-item">'
                             +'<div class="aui-shop-list-item-hd">'
                              + ' <img src="'+data.data[i].img+'" alt="">'
                           +' </div>	'					
                           + '<div class="aui-shop-list-item-bd">'
                               + '<h3>'+data.data[i].title+'</h3>'
                               + '<p class="aui-special-text">'
                               +  '<span>'+data.data[i].enbrand+'</span>'
                               + '</p>'
                              + ' <p class="aui-special-etc">'
                                  + ' <span class="aui-special-etc-hd">￥'+data.data[i].price+'</span>'
                       +'<img src="'+data.data[i].tximg+'" alt="" style="width: 20px;margin-left: 25px;">'
				+' <span style="margin-top: 5px;position: absolute;margin-left: 10px;font-size: 8px;float: right;">'+data.data[i].txname+'</span>'
                   + '</p>'
                           + '</div>'
                       +' </a>'

                        }
                    // 如果没有数据
                    }else{
   						alert('无搜索结果');  
						// 锁定
                        me.lock();
                        // 无数据
                        me.noData();
						

                    }
                        // 插入数据到页面，放到最后面
                        $('.aui-shop-list').append(result);
                        // 每次数据插入，必须重置
                        me.resetload();
							
                
                },
                error: function(xhr, type){
					
					 layer.open({
                    content: '网络异常，请稍等'
                   ,skin: 'msg'
                   ,time: 2 //2秒后自动关闭
                    });	
					
                    // 即使加载出错，也得重置
                    me.resetload();
                }
            });
        }
    });
	
	
	
});	
		
		

		
			  }	

//







			  
			  
			  
			  
		
$(function(){
    // 页数
    var page = 0;
     $('.content').dropload({
        scrollArea : window,
        loadDownFn : function(me){
            page++;
            // 拼接HTML
            var result = '';
            $.ajax({
                type: 'GET',
                url: 'xianzhiapi.php?page='+page+'&sname=1',
                dataType: 'json',
                success: function(data){
					
					if(data==0){
						me.lock();
                        // 无数据
                        me.noData();
						  me.resetload();
						$(".dropload-noData").empty();	
					    $(".dropload-load").empty();
					 // layer.open({
                    // content: 'end'
                   // ,skin: 'msg'
                   // ,time: 2 //2秒后自动关闭
                    // });	
					return false;	
					}
					
					   var arrLen = data.data.length;
			
                    if(arrLen > 0){

                        for(var i=0; i<arrLen; i++){
							
                            result += '<a href="/haigou/htspxq.php?fid='+data.data[i].id+'" class="aui-shop-list-item">'
                             +'<div class="aui-shop-list-item-hd">'
                              + ' <img src="'+data.data[i].img+'" alt="">'
                           +' </div>	'					
                           + '<div class="aui-shop-list-item-bd">'
                               + '<h3>'+data.data[i].title+'</h3>'
                               + '<p class="aui-special-text">'
                               +  '<span>'+data.data[i].enbrand+'</span>'
                               + '</p>'
                              + ' <p class="aui-special-etc">'
                                  + ' <span class="aui-special-etc-hd">￥'+data.data[i].price+'</span>'
                       +'<img src="'+data.data[i].tximg+'" alt="" style="width: 20px;margin-left: 25px;">'
				+' <span style="margin-top: 5px;position: absolute;margin-left: 10px;font-size: 8px;float: right;">'+data.data[i].txname+'</span>'
                   + '</p>'
                           + '</div>'
                       +' </a>'

                        }
                    // 如果没有数据
                    }else{
   						alert('无搜索结果');  
						// 锁定
                        me.lock();
                        // 无数据
                        me.noData();
						

                    }
                        // 插入数据到页面，放到最后面
                        $('.aui-shop-list').append(result);
                        // 每次数据插入，必须重置
                        me.resetload();
							
                
                },
                error: function(xhr, type){
					 layer.open({
                    content: '网络异常，请稍等'
                   ,skin: 'msg'
                   ,time: 2 //2秒后自动关闭
                    });	
                    me.resetload();
                }
            });
        }
    });
	
	
	
});
</script>	
	
    </body>
</html>
